<?php

namespace App\Http\Controllers;

use App\Services\LinkService;
use App\Common\Response;
use Illuminate\Support\Facades\Cache;

class LinksController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $data = Cache::remember('links', 600, function () {
            $linkService = new LinkService;
            return $linkService->getAll();
        });
        return Response::success($data);
    }


}
